package ch10.test;

import java.util.LinkedList;
import java.util.List;

public class LinkedListClass {

	public static void main(String[] args) {
		LinkedList<Student> list = new LinkedList<Student>();
		
		Student stu1 = new Student(1,"dad");
		Student stu2 = new Student(2,"fsd");
		Student stu3 = new Student(3,"dada");
		
		list.addFirst(stu1);
		list.addFirst(stu2);
		list.addFirst(stu3);
		
		Student student = null;
		while ((student = list.pollLast())!=null) {
			System.out.println(student);
		}
		System.out.println("========================");
	}

}
